package expressions;

/**
 * A context for evaluating expressions in.
 * 
 * It allows an expression to request the value of a variable when evaluated,
 * and the parser to set the value of a variable to an expression.
 */
public interface IContext<T>
{
    /**
     * @return the value of a variable represented by varName. If undefined, the
     *         context should either return a default value or throw an
     *         exception, depending on implementation.
     */
    public T getValue(String varName);

    /**
     * Sets varName to equal the Expression variable in the future.
     */
    public void setVariable(String varName, Expression<T> variable);

}
